import request from '@/utils/request'
import { listUser, getUser } from '@/api/system/user'

// 导出用户相关API供订单页面使用
export { listUser, getUser }

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/fun/order/list',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(orderId) {
  return request({
    url: '/fun/order/' + orderId,
    method: 'get'
  })
}

// 新增订单
export function addOrder(data) {
  return request({
    url: '/fun/order',
    method: 'post',
    data: data
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/fun/order',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delOrder(orderId) {
  return request({
    url: '/fun/order/' + orderId,
    method: 'delete'
  })
}

// 更新订单状态
export function updateOrderStatus(orderId, status) {
  return request({
    url: '/app/order/updateStatus/' + orderId + '/' + status,
    method: 'post'
  })
}
